<template >
  <Table
    :columns="tableColumns"
    :data="dataList"
    :pagination="undefined"
  >
    <template #source="{row}">
      {{EnumSourceTypeText[row.source] || "--"}}
    </template>
    <template #denominationFixed="{row}">
      {{row.denominationFixed / 100 || 0}}
    </template>
    <template #denominationMin="{row}">
      {{row.denominationMin / 100 || 0}}
    </template>
    <template #denominationMax="{row}">
      {{row.denominationMax / 100 || 0}}
    </template>
  </Table>
</template>

<script lang="ts" setup >
import {allSchemas, EnumSourceTypeText} from '@/views/digital/cardkeyproduct/cardkeyProduct.data';
import {CardkeyProductVO} from "@/api/digital/cardkeyproduct";

const props = defineProps({
  data: {
    type: Object as PropType<CardkeyProductVO>,
    default: () => {}
  },
})

const tableColumns = computed(()=> {
  return allSchemas.tableColumns.filter(e=> {
    return e.field !== 'action';
  })
})

const dataList = computed(()=> {
  return props.data ? [props.data] : [];
})
</script>
